import request from '@/utils/request'
import { getToken } from '@/utils/auth'

// 坐席分页查询
export function listByPage(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/listByPage',
    method: 'get',
    params: query
  })
}

// 系统所有后台用户
export function listAllUser(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/listSsoUser',
    method: 'get',
    params: query
  })
}

// 添加保存客服坐席
export function saveSeatTable(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/saveCusSeatTable',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}

// 跟单客服
export function listAllTraceCus(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/listTraceOrderCus',
    method: 'get',
    params: query
  })
}

// 合作商
export function listPartnerCompany(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/listPartnerCompany',
    method: 'get',
    params: query
  })
}
// 跟单客服绑定服务对象
export function addTrackCusServiceObject(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/addTrackCusServiceObject',
    method: 'get',
    params: query
  })
}

// 更新跟单客服服务对象
export function updateTrackCusServiceObject(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/updateTrackCusServiceObject',
    method: 'get',
    params: query
  })
}

// 删除客服坐席和服务对象
export function deleteCusSeat(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/seatTable/deleteCusSeat',
    method: 'get',
    params: query
  })
}
